import { createWebHistory, createRouter } from "vue-router";
import { qiankunWindow } from "vite-plugin-qiankun/dist/helper";
function getBasePath() {
  if (qiankunWindow.__POWERED_BY_QIANKUN__) {
    return "/sub-app-vue3";
  }
  return "/";
}
const routes = [
  { path: `/`, component: () => import("./routes/home.vue") },
  {
    path: `/page2`,
    component: () => import("./routes/pages.vue"),
  },
];

export const router = createRouter({
  history: createWebHistory(getBasePath()),
  routes,
});
